
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>中奖信息</title>
    <!--[if lt IE 9]>
    <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <style type="text/css">
        *{margin:0;padding:0;}
        *, *:before, *:after {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
        img{ border:0; max-width:100%; height:auto;}
        body{ font:12px/150% 微软雅黑;color:#000; background-color:#f9b629;}
        .mainbox{ background:#fff;border-radius:5px;padding:10px 10px 20px; margin:10px;}
        .title{border-bottom:1px solid #e8b039;height:30px; line-height:30px; font-size:16px;}
        .title .fl,.listdiv .txt{ float:left;padding-left:20px;}
        .title .fr,.listdiv .time{ float:right;padding-right:20px;}
        .listdiv .list{height:30px; line-height:30px;border-bottom:1px dashed #e8b039; font-size:14px;}
    </style>
    <script type="text/javascript" src="resource/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="../../resources/easyui/plugin/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../resources/js/Util.js"></script>
    <script language="javascript" type="text/javascript">
        //判断是否带有参数
        var appId = '';
        var openId = '';
        if(document.URL.lastIndexOf("?") > 0) {
            var arr=document.URL.substring(document.URL.lastIndexOf("?")+1, document.URL.length).split("&");
            for(var i=0;i<arr.length; i++)
            {
                if(arr[i].split("=")[0] == 'appId') {
                    appId = arr[i].split("=")[1];
                } else if(arr[i].split("=")[0] == 'openId') {
                    openId = arr[i].split("=")[1];
                }
            }
        }

        $(document).ready(function () {
            if(appId == '' || openId == '') {
                document.body.innerHTML = '请关注内蒙古呼和浩特移动微信号，以指定方式参加活动。';
            }

            setMyPrizes();
        });

        function setMyPrizes() {
            var html='';
            var prizeList = $('#prizeList');
            restClient('/rest/game/prize/wheel1', function(data){
                for(var o in data) {
                    html += '<div class="list"><span class="txt">';

                    var tel = data[o].tel;
                    tel = tel.substring(0,3)+"****"+tel.substring(7,11);
                    var result = data[o].result;
                    html += tel + "  " + result + "</span>";

                    html += '<span class="time">' + new Date(data[o].finishTime).format('yyyy年MM月dd日') + '</span></div>';
                }
                prizeList.html(html);

            }, {appId: appId, openId: openId})
        }
    </script>
</head>
<body>
<form method="post" action="" id="form1">
    <div class="mainbox">
        <div class="title"><span class="fl">奖品</span><span class="fr">时间</span></div>
        <div class="listdiv" id="prizeList"></div>
    </div>
</form>
</body>
</html>
